<?php
$row=intval($_GET[row]);
$key=intval($_GET[key]);

echo "
var row;
if (opener!=null)
{row=opener.document.getElementById('row_'+$row);}
else
{row=document.getElementById('row_'+$row);}
";

if($row){
switch($key){
case 'mark':
if(preg_match("/dispatcher|admin/",$_SESSION[group])){
$marker=intval($_GET[mark]);
$_db->exec("UPDATE orders SET marker=$marker WHERE id=$row");
if($marker) $markcolor=sprintf("#%06X",$marker);
else $markcolor="#FFFFFF";
echo "
row.cells[5].style.backgroundColor='$markcolor';";
}
break;
default:
}
}
?>